<?php
/**
 * Created by PhpStorm.
 * User: yuanjie
 * Date: 15/9/15
 * Time: 下午4:10
 */
class SystemUser extends Eloquent
{
    protected $table = "system_users";

    public static function getUser($userid,$password){
        return SystemUser::where('userid',$userid)->where('password',$password)->first();
    }

    public static function delUser($user_id){
        return SystemUser::where('id',$user_id)->delete();
    }

    public static function insUser($data){
        return SystemUser::insert($data);
    }

    public static function saveUserToken($id,$token){
        return SystemUser::where('id',$id)->update(array('token' => $token));
    }

}